package com.koudai.finance.task;

import com.koudai.finance.service.StockService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Description：订单定时任务
 * @Author: ls
 * @Date: 2021/1/8 10:28 上午
 */
@Component
@Slf4j
public class Schedule {

    @Resource
    private StockService stockServiceImpl;

    /**
     * @Description： 凌晨1点更新
     * @Author: ls
     * @Date: 2021/1/8 10:31 上午
     */
    @Scheduled(cron = "0 0 1 * * ?")
    public void updateFailOrder() {
        stockServiceImpl.syncCode();
        stockServiceImpl.syncWeekData();
        stockServiceImpl.computeChance();
    }

}
